clear 
import delimited "03-Silencing-Study/data/01-clean-data/clean_data.csv"

//Table S8
//main effect
xi: reg puresilencing female male noname i.experiment1, r 
di e(r2_a)
//Study 1 only
xi: reg puresilencing female male noname if experiment1 == 1, r 
di e(r2_a)
//Study 2 only
xi: reg puresilencing female male noname if experiment1 == 0, r 
di e(r2_a)

///By gender
///subset to women only
xi: reg puresilencing female male noname i.experiment1 if gender=="female", r 
di e(r2_a)
///subset to men only
xi: reg puresilencing female male noname i.experiment1 if gender=="male", r 
di e(r2_a)

///Table S13
//main effect
xi: reg responded female male noname i.experiment1, r
di e(r2_a)
//study 1
xi: reg responded female male noname if experiment1 == 1, r
di e(r2_a)
//study 2
xi: reg responded female male noname if experiment1 == 0, r
di e(r2_a)
///subset to women only
xi: reg responded female male noname i.experiment1 if gender=="female", r 
di e(r2_a)
///subset to men only
xi: reg responded female male noname i.experiment1 if gender=="male", r 
di e(r2_a)

/// Table S17
xi: reg puresilencing female male noname i.experiment1 if responded == 100, r 
di e(r2_a)
//Study 1 only
xi: reg puresilencing female male noname if experiment1 == 1 & responded == 100, r 
di e(r2_a)
//Study 2 only
xi: reg puresilencing female male noname if experiment1 == 0 & responded == 100, r 
di e(r2_a)
//women only
xi: reg puresilencing female male noname i.experiment1 if responded == 100 & gender == "female", r 
di e(r2_a)
//men only
xi: reg puresilencing female male noname i.experiment1 if responded == 100 & gender == "male", r 
di e(r2_a)

//Table S26
//main effect
xi: reg puresilencing female male noname i.experiment1, r cluster(texterid)
di e(r2_a)
//Study 1 only
xi: reg puresilencing female male noname if experiment1 == 1, r cluster(texterid)
di e(r2_a)
//Study 2 only
xi: reg puresilencing female male noname if experiment1 == 0, r cluster(texterid)
di e(r2_a)

///By gender
///subset to women only
xi: reg puresilencing female male noname i.experiment1 if gender=="female", r cluster(texterid)
di e(r2_a)
///subset to men only
xi: reg puresilencing female male noname i.experiment1 if gender=="male", r cluster(texterid)

/// Replicating Table S29
//main effect
xi: ivreg puresilencing i.experiment1 (femaleinstrument maleinstrument nonameinstrument = female male noname), r 
di e(r2_a)
//Study 1
xi: ivreg puresilencing (femaleinstrument maleinstrument nonameinstrument = female male noname) if experiment1 == 1, r 
di e(r2_a)
//Study 2
xi: ivreg puresilencing (femaleinstrument maleinstrument nonameinstrument = female male noname) if experiment1 == 0, r 
di e(r2_a)

///By gender
///subset to women only
xi: ivreg puresilencing i.experiment1 (femaleinstrument maleinstrument nonameinstrument = female male noname) if gender=="female", r 
di e(r2_a)
///subset to men only
xi: ivreg puresilencing i.experiment1 (femaleinstrument maleinstrument nonameinstrument = female male noname) if gender=="male", r 
di e(r2_a)
